import java.util.Random;
public class test46 {
    // 计算两点间距离
    private static double distance(double x1, double y1, double x2, double y2) {
        return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
    }
    private static double angle(double a, double b, double c) {
        return Math.toDegrees(Math.acos((a * a + b * b - c * c) / (2 * a * b)));
    }
    public static void main(String[] args) {
        Random random = new Random();
        final double RADIUS = 40;
        double alpha1 = random.nextDouble() * 2 * Math.PI;
        double alpha2 = random.nextDouble() * 2 * Math.PI;
        double alpha3 = random.nextDouble() * 2 * Math.PI;
        double x1 = RADIUS * Math.cos(alpha1);
        double y1 = RADIUS * Math.sin(alpha1);
        double x2 = RADIUS * Math.cos(alpha2);
        double y2 = RADIUS * Math.sin(alpha2);
        double x3 = RADIUS * Math.cos(alpha3);
        double y3 = RADIUS * Math.sin(alpha3);
        double a = distance(x2, y2, x3, y3);
        double b = distance(x1, y1, x3, y3);
        double c = distance(x1, y1, x2, y2);
        double angleA = angle(b, c, a);
        double angleB = angle(a, c, b);
        double angleC = angle(a, b, c);
        System.out.printf("三个角的度数：%.2f°, %.2f°, %.2f°%n", angleA, angleB, angleC);
    }
}

